const initState = {
    map:[]
}
export default function (state=initState,action) {
    switch(action.type) {
        case 'insertBlock':
            const map = [...state.map, action.position]
            return {
                map
            }
            case 'removeBlock':
                const map1 = state.map.filter((item,index) =>{
                    return index !== action.index
                })
                return {
                    map:map1
                }
                case 'resetBlock':
                    return {
                        map: []
                    }
                default:
                return state
    }
}